-
Notifications
You must be signed in to change notification settings - Fork 587
feat: do not export private declarations #8337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
!bench |
Mathlib CI status (docs):
|
Here are the benchmark results for commit 58edbda. Benchmark Metric Change
====================================================================
+ Init size bytes .olean -9.1%
- Init size bytes .olean.private 4.8%
+ bv_decide_inequality.lean task-clock -6.2% (-21.5 σ)
+ bv_decide_inequality.lean wall-clock -5.9% (-24.0 σ)
+ import Lean branches -3.3% (-89.9 σ)
+ import Lean instructions -3.6% (-89.3 σ)
+ import Lean maxrss -1.3% (-77.5 σ)
+ import Lean task-clock -10.9% (-25.8 σ)
+ import Lean wall-clock -10.9% (-25.3 σ)
+ lake build clean instructions -1.1% (-23.9 σ)
+ lake build clean task-clock -4.7% (-43.0 σ)
+ lake build clean wall-clock -3.6% (-21.7 σ)
+ lake config elab instructions -1.2% (-76.1 σ)
+ lake config elab maxrss -1.2% (-29.2 σ)
+ lake config import instructions -2.5% (-192.3 σ)
+ lake config import maxrss -2.5% (-143.3 σ)
+ lake config tree instructions -2.4% (-34.8 σ)
+ lake config tree maxrss -2.5% (-47.9 σ)
+ lake env instructions -2.5% (-124.2 σ)
+ lake env maxrss -2.5% (-72.8 σ)
+ language server startup branches -1.3% (-36.2 σ)
+ language server startup instructions -1.4% (-32.5 σ)
- nat_repr branches 1.4% (247.0 σ)
- nat_repr instructions 1.4% (194.8 σ)
+ stdlib maxrss -1.6% (-172.3 σ)
+ stdlib wall-clock -2.5% (-37.1 σ)
- stdlib size bytes .olean.private 4.8%
+ workspaceSymbols maxrss -1.6% (-25.2 σ) |
2f371ff
to
6886d98
Compare
!bench |
Here are the benchmark results for commit 6886d98. Benchmark Metric Change
===========================================
+ Init size bytes .olean.private -2.4%
+ stdlib size bytes .olean.private -2.4% |
86ee842
to
c7702ad
Compare
-- Private definitions are not exported but may still have relevant IR for other modules. | ||
-- TODO: restrict to relevant defs that are `meta`/inlining-relevant/... | ||
if env.setExporting true |>.contains name then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zwarich My "use the private name encoding to find the source module of an IR decl" idea did not work out because of specalization names, so now we're using extraConstNames
for them, for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just change the specialization name encoding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it matters until we start restricting the data of declMapExt
itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems plausible
src/Lean/Elab/SyntheticMVars.lean
Outdated
let mut e ← instantiateExprMVars (.mvar mvarId') | ||
if !e.isFVar then | ||
e ← mvarId'.withContext do | ||
AbstractNestedProofs.visit.mkAuxLemma e |>.run { cache := true } |>.run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it’s using “internal” functions from AbstractNestedProofs
? Why not Lean.Meta.abstractNestedProofs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder, I did want to refactor this before I forgot
!bench |
Here are the benchmark results for commit 3fe3eeb. Benchmark Metric Change
=========================================================
+ Init size bytes .olean.private -3.3%
- bv_decide_mul wall-clock 1.8% (74.1 σ)
- qsort instructions 5.3% (1028.0 σ)
- riscv-ast.lean branches 3.7% (39.1 σ)
- riscv-ast.lean instructions 3.5% (34.1 σ)
- stdlib blocked 1.5% (34.0 σ)
+ stdlib size bytes .olean.private -3.3% |
f60bbd3
to
658d85a
Compare
|
* Update lean-toolchain for testing leanprover/lean4#8347 * fixes for leanprover/lean4#8347 * Update lean-toolchain for testing leanprover/lean4#8397 * deprecations for leanprover/lean4#8397 * chore: bump to nightly-2025-05-19 * chore: adaptations for nightly-2025-05-19 * Trigger CI for leanprover/lean4#8347 * Update the style linter to use LinterOptions * Fix test * chore: adaptations for nightly-2025-05-19 (#25017) Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: Sebastian Ullrich <[email protected]> * chore: bump to nightly-2025-05-20 * Merge master into nightly-testing * feat: a `grind` test case (#25037) Adds a test case for `grind` that was previously failing in the presence of Mathlib's typeclass shortcuts. Let's just keep it in Mathlib as a regression test. Note that this is a PR to `bump/v4.21.0`, as it requires a recent nightly toolchain. (It can still be reviewed and bors'd as any other PR.) * lake update * fixes * fixes * fixes * fixes * fix * fixes * fixes * shake --update * chore: bump to nightly-2025-05-21 * Update lean-toolchain for testing leanprover/lean4#7352 * lake update * Trigger CI for leanprover/lean4#7352 * chore: adaptations for nightly-2025-05-21 * chore: adaptations for nightly-2025-05-21 (#25079) Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> * chore: adaptations for nightly-2025-05-21 * fix for leanprover/lean4#7352 * remove unneeded List.ofFn_succ from simp sets * Merge master into nightly-testing * Merge master into nightly-testing * Revert "fix for leanprover/lean4#7352" This reverts commit 38ca408. * chore: fix some defeq abuse in theorem statements around the `Id` monad (#25098) Follows on from leanprover/lean4#7352. This also deprecates: * `id.mk`, which looks like a porting error * `Free(Add)(Magma|Semigroup).mul_map_seq`, which is a garbage lemma that both is not meaningfully about the free objects and has defeq abuse everywhere. * chore: bump to nightly-2025-05-22 * update batteries * chore: bump to nightly-2025-05-23 * Update lean-toolchain for testing leanprover/lean4#8449 * chore: adaptations for nightly-2025-05-22 (#25110) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: github-actions <[email protected]> * remove now upstreamed `clear_value` * Update lean-toolchain for testing leanprover/lean4#8457 * chore: update tests for `Format` bug fix * Trigger CI for leanprover/lean4#8457 * lake update * lake update * fixes * Merge master into nightly-testing * chore: bump to nightly-2025-05-24 * fix * chore: adaptations for nightly-2025-05-24 (#25147) Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: github-actions <[email protected]> * chore: adaptations for nightly-2025-05-24 * Merge master into nightly-testing * Update lean-toolchain for testing leanprover/lean4#8470 * chore: bump to nightly-2025-05-25 * chore: adaptations for nightly-2025-05-25 * chore: adaptations for nightly-2025-05-25 (#25184) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: github-actions <[email protected]> * unsimp `List.getElem?_length` This is solved using `getElem?_neg` now. * chore: adaptations for nightly-2025-05-25 * Trigger CI for leanprover/lean4#8470 * chore: bump to nightly-2025-05-26 * lake update * deprecations * Trigger CI for leanprover/lean4#8449 * Merge master into nightly-testing * chore: bump to nightly-2025-05-27 * chore: adaptations for nightly-2025-05-27 * Update lean-toolchain for testing leanprover/lean4#8504 * chore: bump to nightly-2025-05-28 * chore: adaptations for nightly-2025-05-27 (#25234) Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Kim Morrison <[email protected]> * fix * fix merge * fix merge again * deprecations * deprecations * fix Archive * comment out test * Fix and re-enable directory dependency lint test. * chore: bump to nightly-2025-05-29 * Use the formatting from the master branch. (Seems to have been a merge that went wrong.) * lake update * chore: adaptations for nightly-2025-05-28 (#25295) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: github-actions <[email protected]> * fix * Trigger CI for leanprover/lean4#8337 * fixes * Merge master into nightly-testing * chore: bump to nightly-2025-05-30 * chore: adaptations for nightly-2025-05-29 (#25306) Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Rob23oba <[email protected]> * chore: bump to nightly-2025-05-31 * chore: bump to nightly-2025-06-01 * fix Archive * chore: adaptations for nightly-2025-06-01 (#25355) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> * chore: bump to nightly-2025-06-02 * chore: adaptations for nightly-2025-06-02 (#25360) Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: github-actions <[email protected]> * Update lean-toolchain for testing leanprover/lean4#8584 * chore: adaptations for nightly-2025-06-02 * chore: bump to nightly-2025-06-03 * fix * fix * Update lean-toolchain for testing leanprover/lean4#8610 * fix * chore: bump to nightly-2025-06-04 * bump toolchain --------- Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: Sebastian Ullrich <[email protected]> Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: Rob23oba <[email protected]> Co-authored-by: Joseph Rotella <[email protected]>
* chore: adaptations for nightly-2025-05-21 * fix for leanprover/lean4#7352 * remove unneeded List.ofFn_succ from simp sets * Merge master into nightly-testing * Merge master into nightly-testing * Revert "fix for leanprover/lean4#7352" This reverts commit 38ca408. * chore: fix some defeq abuse in theorem statements around the `Id` monad (#25098) Follows on from leanprover/lean4#7352. This also deprecates: * `id.mk`, which looks like a porting error * `Free(Add)(Magma|Semigroup).mul_map_seq`, which is a garbage lemma that both is not meaningfully about the free objects and has defeq abuse everywhere. * chore: bump to nightly-2025-05-22 * update batteries * chore: bump to nightly-2025-05-23 * Update lean-toolchain for testing leanprover/lean4#8449 * chore: adaptations for nightly-2025-05-22 (#25110) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: github-actions <[email protected]> * remove now upstreamed `clear_value` * Update lean-toolchain for testing leanprover/lean4#8457 * chore: update tests for `Format` bug fix * Trigger CI for leanprover/lean4#8457 * lake update * lake update * fixes * Merge master into nightly-testing * chore: bump to nightly-2025-05-24 * fix * chore: adaptations for nightly-2025-05-24 (#25147) Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: github-actions <[email protected]> * chore: adaptations for nightly-2025-05-24 * Merge master into nightly-testing * Update lean-toolchain for testing leanprover/lean4#8470 * chore: bump to nightly-2025-05-25 * chore: adaptations for nightly-2025-05-25 * chore: adaptations for nightly-2025-05-25 (#25184) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: github-actions <[email protected]> * unsimp `List.getElem?_length` This is solved using `getElem?_neg` now. * chore: adaptations for nightly-2025-05-25 * Trigger CI for leanprover/lean4#8470 * chore: bump to nightly-2025-05-26 * lake update * deprecations * Trigger CI for leanprover/lean4#8449 * Merge master into nightly-testing * chore: bump to nightly-2025-05-27 * chore: adaptations for nightly-2025-05-27 * Update lean-toolchain for testing leanprover/lean4#8504 * chore: bump to nightly-2025-05-28 * chore: adaptations for nightly-2025-05-27 (#25234) Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Kim Morrison <[email protected]> * fix * Update lean-toolchain for testing leanprover/lean4#8519 * fix merge * fix merge again * deprecations * deprecations * fix Archive * comment out test * Fix and re-enable directory dependency lint test. * chore: bump to nightly-2025-05-29 * Use the formatting from the master branch. (Seems to have been a merge that went wrong.) * lake update * chore: adaptations for nightly-2025-05-28 (#25295) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: github-actions <[email protected]> * fix * Trigger CI for leanprover/lean4#8337 * Trigger CI for leanprover/lean4#8519 * fixes * Merge master into nightly-testing * chore: bump to nightly-2025-05-30 * chore: adaptations for nightly-2025-05-29 (#25306) Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Rob23oba <[email protected]> * chore: bump to nightly-2025-05-31 * chore: bump to nightly-2025-06-01 * chore: remove simp attribute when value of argument can not be inferred by simp * fix Archive * chore: adaptations for nightly-2025-06-01 (#25355) Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> * chore: bump to nightly-2025-06-02 * chore: adaptations for nightly-2025-06-02 (#25360) Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: github-actions <[email protected]> * Update lean-toolchain for testing leanprover/lean4#8584 * chore: adaptations for nightly-2025-06-02 * change phrasing of comments * chore(Geometry/Manifold): two simp-lemmas can be proven by simp * fix two lint problems * Trigger CI for leanprover/lean4#8519 * chore: bump to nightly-2025-06-03 * fix * fix * Update lean-toolchain for testing leanprover/lean4#8610 * fix * revert change in `Mathlib.Data.ZMOD.Basic` * fix Mathlib/Data/List/EditDistance/Estimator.lean * give specialized simp lemmas higher prio * simp can prove these * simp can prove these * chore: bump to nightly-2025-06-04 * bump toolchain * Adapt eqns * Revert "Adapt eqns" This reverts commit 34f1f7f. * Simply remove check for now * fix a bunch * fixes? * chore: adaptations for nightly-2025-06-04 * add `simp low` lemma `injOn_of_eq_iff_eq` * wip * wip * wip * fix * Trigger CI for leanprover-community/batteries#1220 * Merge master into nightly-testing * chore: bump to nightly-2025-06-05 * Kick CI * Bump lean4-cli * Bump import-graph * Kick CI * update lakefile * chore: use more robust syntax quotation in Shake * cleanup lakefile --------- Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Rob23oba <[email protected]> Co-authored-by: Joseph Rotella <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: Sebastian Ullrich <[email protected]> Co-authored-by: Johan Commelin <[email protected]> Co-authored-by: Jovan Gerbscheid <[email protected]> Co-authored-by: Joachim Breitner <[email protected]>
This PR adjusts the experimental module system to not export any private declarations from modules.
Fixes #5002